Skip to main content
Version: 5.1

TimePunch User Group Service

The user group service allows grouping of employee profiles. Thus, employees can be grouped together for teams, departments, and offices.

CreateUserGroup

This method creates a new group and returns it. It is important that the group not yet gets stored to the database. This happens only when the group is saved.

UserGroupDto CreateUserGroup(  
out TpFault fault,
TpAuthentication authentication,
GroupType groupType);
Needed PermissionuserGroups@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
groupTypeType of the user group that shall be created (e.g. Team, Department, Branch)
Return valueReturns the created user group

DeleteUserGroups

This method clears the passed user groups. The members of the group will not be associated any other group.

void DeleteUserGroups(  
out TpFault fault,
TpAuthentication authentication,
Guid[] userGroupIds);
Needed PermissionuserGroups@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userGroupIdsList that contains all user group ids that shall be deleted.
Return value-

ImportUserGroupAssignments

This method imports the passed group memberships. In contrast to the save method, the ID and not the common name of the group is important.

UserGroupMemberDto[] ImportUserGroupAssignments(  
out TpFault fault,
TpAuthentication authentication,
GroupType groupType,
UserGroupMemberDto[] groupAssignments);
Needed PermissionuserGroups@import
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
groupTypeType of the user group for which the group assignments shall be imported
groupAssignmentsUser Group assignments to import
Return value-

LoadUserGroup

This method loads the group with the specified ID and returns it.

UserGroupDto LoadUserGroup(  
out TpFault fault,
TpAuthentication authentication,
Guid userGroupId);
Needed PermissionuserGroups@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userGroupIdId of the user group to load
Return valueReturns the loaded user group

SaveUserGroup

This method saves the user group in the database. It is important that if the group members in the object are NULL, only the basic data of the Group gets stored.

UserGroupDto SaveUserGroup(  
out TpFault fault,
TpAuthentication authentication,
UserGroupDto userGroup);
Needed PermissionuserGroups@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userGroupThe user group to save
Return valueReturns the persisted user group

SaveUserGroupAssignments

This method saves the group membership of employee profiles to the given group.

void SaveUserGroupAssignments(  
out TpFault fault,
TpAuthentication authentication,
UserGroupSaveMemberDto[] groupAssignments);
Needed PermissionuserGroups@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
groupAssignmentsUser Group assignments to save
Return value-

SearchAssignableUsers

This method returns all employee profiles that can be associated with the passed type of group.

UserGroupMemberDto[] SearchAssignableUsers(  
out TpFault fault,
TpAuthentication authentication,
GroupType groupType,
Guid userGroupId);
Needed PermissionuserGroups@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
groupTypeGroup type for that the user profiles shall be searched
userGroupIdId of the user group that shall be used as a target for the assignable user profiles.
Return valueReturns the found user groups

SearchCoveredUserGroups

This method searches for user groups where the employee has the lead, or is registered at least as an Assistant of the group.

UserGroupDto[] SearchCoveredUserGroups(  
out TpFault fault,
TpAuthentication authentication,
UserGroupSearchDto userGroupSearch);
Needed PermissionuserGroups@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userGroupSearchThe user group definition to search for
Return valueReturns the found user groups

SearchUserGroupAssignments

This method returns all members of the group to which the profile search fits and agrees with the passed type of group. The data are used primarily for the export of the group.

UserGroupMemberDto[] SearchUserGroupAssignments(  
out TpFault fault,
TpAuthentication authentication,
UserSearchDto userSearch,
GroupType groupType);
Needed PermissionuserGroups@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userSearchUse the given user search object to tailor the search results.
groupTypeGroup type for that the user profiles shall be searched
Return valueReturns the found user assignments

SearchUserGroup

This method searches for user groups with the given properties. It can be searched for the group name and the group type.

UserGroupDto[] SearchUserGroups(  
out TpFault fault,
TpAuthentication authentication,
UserGroupSearchDto userGroupSearch);
Needed PermissionuserGroups@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userGroupSearchThe user group definition to search for
Return valueReturns the found user groups